import type { RouteRecordRaw } from "vue-router";
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      hidden: true,
    },
  },

  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404.vue"),
    meta: {
      hidden: true,
    },
  },

  {
    path: "/",
    component: () => import("@/layout/index.vue"),
    redirect: "/home",

    children: [
      {
        path: "home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        // 1. 决定左侧菜单显示什么内容 2. 决定网站的title
        meta: {
          title: "首页",
          icon: "ele-HomeFilled",
        },
      },
    ],
  },
];

/**
 * 定义动态路由
 */
export const allAsyncRoutes: Array<RouteRecordRaw> = [
  /**系统管理satrt */
  {
    path: "/system",
    name: "Acl",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "系统管理",
      icon: "ele-Coffee",
    },
    children: [
      {
        path: "user",
        name: "Acl/User",
        component: () => import("@/views/system/User/index.vue"),
        meta: {
          title: "用户管理",
        },
      },
      {
        path: "role",
        name: "Acl/Role",
        component: () => import("@/views/system/Role/index.vue"),
        meta: {
          title: "角色管理",
        },
      },
      {
        path: "menu",
        name: "Acl/Permision",
        component: () => import("@/views/system/Menu/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
  /**系统管理end */

  /**数据管理 */
  {
    path: "/dataAdmin",
    name: "Cmn",
    component: () => import("@/layout/index.vue"),
    alwaysShow: true,
    meta: {
      title: "数据管理",
      icon: "ele-Orange",
    },
    children: [
      {
        path: "dict",
        name: "Cmn/Dict",
        component: () => import("@/views/dictionary/index.vue"),
        meta: {
          title: "数据字典",
        },
      },
    ],
  },

  /**医院管理start */
  {
    path: "/hospital",
    name: "Hospital",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "医院管理",
      icon: "ele-Orange",
    },
    children: [
      {
        path: "hospitalSet",
        name: "Hospital/Set",
        component: () => import("@/views/hospital/HospitalSet/index.vue"),
        meta: {
          title: "医院设置",
        },
      },
      {
        path: "hospitalList",
        name: "Hospital/List",
        component: () => import("@/views/hospital/HospitalList/index.vue"),
        meta: {
          title: "医院列表",
        },
      },
    ],
  },
  /**医院管理end */

  /**订单管理start */
  {
    path: "/order",
    name: "Order",
    component: () => import("@/layout/index.vue"),
    alwaysShow: true,
    meta: {
      title: "订单管理",
      icon: "ele-Orange",
    },
    children: [
      {
        path: "orderList",
        name: "Order/orderList",
        component: () => import("@/views/order/OrderList/index.vue"),
        meta: {
          title: "订单列表",
        },
      },
    ],
  },
  /**订单管理end */

  /**会员管理start */
  {
    path: "/vip",
    name: "Member",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "会员管理",
      icon: "ele-Orange",
    },
    children: [
      {
        path: "vipList",
        name: "Member/List",
        component: () => import("@/views/vip/VipList/index.vue"),
        meta: {
          title: "会员列表",
        },
      },
      {
        path: "vipDetail",
        name: "Member/Show",
        component: () => import("@/views/vip/VipList/vipDetail.vue"),
        meta: {
          hidden: true,
          title: "会员详情",
        },
      },
      {
        path: "approveList",
        name: "Member/certificationApprovalList",
        component: () => import("@/views/vip/ApproveList/index.vue"),
        meta: {
          title: "审批列表",
        },
      },
      // {
      //   path: "approveDetail",
      //   name: "Member/Show",
      //   component: () => import("@/views/vip/ApproveList/approveDetail.vue"),
      //   meta: {
      //     hidden: true,
      //     title: "审批详情",
      //   },
      // },
    ],
  },
  /**医院管理end */
];

/**
 * 定义全局任意路由
 */
export const anyRouters: Array<RouteRecordRaw> = [
  /* 匹配任意的路由 必须最后注册 */
  {
    path: "/:pathMatch(.*)",
    name: "Any",
    redirect: "/404",
    meta: {
      hidden: true,
    },
  },
];
